import request from '@/utils/request'

// 查询商品列表
export function listGoodsManage(query) {
  return request({
    url: '/supplier/goodsManage/list',
    method: 'get',
    params: query
  })
}

// 查询商品列表
export function listSelect(query) {
  return request({
    url: '/supplier/goodsManage/listSelect',
    method: 'get',
    params: query
  })
}


// 查询商品详细
export function getGoodsManage(goodsId) {
  return request({
    url: '/supplier/goodsManage/' + goodsId,
    method: 'get'
  })
}

// 查询商品库存
export function getGoodsStock(query) {
  return request({
    url: '/supplier/3rdstock/selectGoodsStockFromT3rdstock',
    method: 'get',
    params: query,
  })
}

//查询商品详情
export function getGoodInfoManage(goodsId) {
  return request({
    url: '/supplier/goodsManage/info/' + goodsId,
    method: 'get'
  })
}
// 新增商品
export function addGoodsManage(data) {
  return request({
    url: '/supplier/goodsManage',
    method: 'post',
    data: data
  })
}

// 上传图片
export function uploadPicture(data) {
  return request({
    url: '/common/upload',
    method: 'post',
    data: data
  })
}

// 修改商品
export function updateGoodsManage(data) {
  return request({
    url: '/supplier/goodsManage',
    method: 'put',
    data: data
  })
}

// 删除商品
export function delGoodsManage(goodsId) {
  return request({
    url: '/supplier/goodsManage/' + goodsId,
    method: 'delete'
  })
}
